<?php

use Drupal\shusy_city\Entity\ShusyCity;
use Drupal\shusy_index_category\Entity\ShusyIndexCategory;

function shusy_index_category_shusy_index_category_add_page() {
  $e = new ShusyIndexCategory();
  module_load_include('inc', 'shusy_index_category', 'shusy_index_category.forms');
  return drupal_get_form('shusy_index_category_shusy_index_category_entity_form', $e, 'add');
}

function shusy_index_category_shusy_index_category_view_page(ShusyIndexCategory $e) {
  return entity_view($e->entityType(), [$e]);
}

function shusy_index_category_shusy_index_category_edit_page(ShusyIndexCategory $e) {
  module_load_include('inc', 'shusy_index_category', 'shusy_index_category.forms');
  return drupal_get_form('shusy_index_category_shusy_index_category_entity_form', $e, 'edit');
}

function shusy_index_category_shusy_index_category_delete_page(ShusyIndexCategory $e) {
  module_load_include('inc', 'shusy_index_category', 'shusy_index_category.forms');
  return drupal_get_form('shusy_index_category_shusy_index_category_delete_form', $e);
}


function shusy_index_category_city_add_page(ShusyCity $city) {
  $e = new ShusyIndexCategory();
  $e->city_id = $city->id;
  module_load_include('inc', 'shusy_index_category', 'shusy_index_category.forms');
  return drupal_get_form('shusy_index_category_shusy_index_category_entity_form', $e, 'add');
}
